<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/jsp/comm_css_include.jsp"%>
<!doctype html>
<html>
<head>

</head>
<body class="gray-bg">
<!-- 隐藏域 -->
<input id="busiId" name="busiId" type="hidden" />
<div class="container creditbody">
	<div class="iboxtitle">
		<span><i class="glyphicon glyphicon-map-marker"></i>&nbsp;&nbsp;业务受理&nbsp;&gt;&nbsp;通融处理</span>
		<a href="javascript:void(0)"></a>
	</div>
	<div class="buttonfixed">
		<button type="button" class="btn dpbtn_blue btnaplly" id="applyTongrong">发起通融</button>
	</div>
	<div class="ibox-content ibox-con">
		<form class="form-horizontal" id="">
			<%@include file="/jsp/comm_yw_info_include.jsp"%>
		</form>
		</div>
		<div class="business-manwife">审批记录</div>
        <div class="ul-style">
        	<form class="form-horizontal business-form">
            	<div class="business-padding" id="historical_approval" name="historical_approval">
            		&nbsp;
            	</div>	
			</form>	
		</div>
		<div class="business-manwife">通融资料</div>
		<div class="padding-nono">
			<div class="zx-addimg">
				<ul id="SHEN_QING_TONG_RONG">
					<li class="firstMuliUploadButton zx-upimg">
						<img src="${basePath}/img/shangchuanzhaopian.png" width="110px" height="110px" class="zx-imgPre" style="display: block;" />
						<div class="img-layer">
							<div></div>
							<span filelabelLabelSpan="${attachmentLabelNames.SQTR_GENG_DUO }">${attachmentLabelNameValues.SQTR_GENG_DUO }</span>
						</div> 
						<a href="javascript:;" class="file" onclick="uploadFileClicked(this,'img');" modeId="${modeIDTypeNames.SQTR }" ulId="SHEN_QING_TONG_RONG" customLabel="true" isAdd="true" fileLabelLi="${attachmentLabelNames.SQTR_GENG_DUO }" defaltLabelNameLi="${attachmentLabelNameValues.SQTR_GENG_DUO }" subId="" >
						</a>
					</li>
				</ul>
			</div>
		</div>
		
	   	<div class="business-manwife">通融详情</div>
	   	<div class="business-padding">
			<table cellpadding="0" cellspacing="0" border="0" class="buyinfor-table">
				<tr>	
					<td align="right" valign="top">
						<label class="control-label np">通融详情：</label>
					</td>
					<td>
						<textarea rows="2" cols="150" id="remark" maxlength="500" class="textarea-control" ></textarea>
					</td>
				</tr>
			</table>		
		</div>
	   	
	</form>
</div>	
	<!-- public quote -->
    <%@include file="/jsp/comm_js_include.jsp"%>
    
    <!-- 文件上传 -->
 	<%@include file="/jsp/common_fileupload_multi_include.jsp"%>
    <!--
    	作者：zhangpp
    	时间：2017-04-06
    	描述：js
    -->
    <script type="text/javascript">
	    jQuery(function($) {
	    	initData();
	    });
	    var initData = function()
	 	{
	 		var busiId = $.getUrlData("busiId");
	 		$('#busiId').val(busiId);
	 		
	 		showAttentment($('#busiId').val(),null,'${modeIDTypeNames.SQTR }');
	 		$.dpAjax({
	 			show:false,
		   		url:'${basePath}/FengKongShenHeController/getOtherAuditListVo',
		   		data:{
// 		   			"modeId":"GPS",
		   			"busiId":busiId
		   		},
				success: function(datas){
			 	  if(datas.flag == "100100")
			 	  {
			 		  var d = datas.result;
			 		  
			 		  var content = '';
			 		 
			 		  for(var i=0;i<d.length;i++)
			 		  {
			 			  var audit_name = d[i].auditName
			 			  var org_name = d[i].orgName
			 			  var creator_name = d[i].creatorName;
			 			  var created = d[i].created;
			 			  var audit_detail = d[i].auditDetail;
			 			  
		 			      content += '<ul class="course-table">'
			 			  			  + '<li  class="rgb-color">'+audit_name+'</li>'
			 			  			  + '<li class="course-tablelib">'
			 			  			  	+ '<p class="course-time">'+org_name+' &nbsp; '+creator_name+' &nbsp;'+created+'</p>'
			 			  			  	+ audit_detail
			 			  			  + '</li>'
			 			  		  + '</ul>';
			 		  }
			 		  
			 		  $('#historical_approval').html(content);
			 		  
			 		  
			 		  //GPS数据
// 			 		  var d = datas.gpsResult;
			 		  
// 			 		  if(d && d.length > 0)
// 			 		  { 
// 			 			  d = d[0];
// 			 			  var type_extras = d.typeExtras;
// 			 			  var value_extras = d.valueExtras;
// 			 			  $('#type_extras').val(type_extras);
// 			 			  $('#value_extras').val(value_extras);
// 			 		  }
// 			 		  return;
						return;
				  }
				  if(datas.flag == "100200"){
					  alert(JSON.stringify(datas));
		              return;
		          }
				  layer.msg(datas.message, {icon: 2});
				}
		   	});
	 	}
	    $('#applyTongrong').click(function(){
	    	applyTongrong();
        });
	    var applyTongrong=function(){
	    	var data={};
	    	data.reasonTongrong=$("#remark").val();
	    	data.busiId=$.getUrlData("busiId");
	    	data.cusId=$.getUrlData("cusId");
	    	layer.confirm('确认申请通融？操作人：<span style="color:#BD1723;">${current_user_key.uname}</span>', {
				  btn: ['确认','取消'] //按钮
				}, function(){
				layer.closeAll();
		    	$.dpAjax({
		    		url:'${basePath}/YwTongrongController/tongrong',
		    		data:data,
	    			success: function(datas){
		    			  if(datas.flag == "100100")
						  {
	// 						  layer.msg('执行成功！', {icon: 6});
							  window.location.href="${basePath}/web/system/yw/applyTongrongList.jsp";
							  return;
						  }
						  if(datas.flag == "100200")
		                  {
							  $.fn.showDatas({"datas":datas});
		                	  return;
		                  }
	                 }
		    	});
			})	
	    }
    </script>
</body>
</html>
